package com.strive.demo.web.config;

import com.strive.demo.web.filter.WebCorsFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 跨域配置
 *
 * @author bingcun.chen
 * @date 2022/10/5

 */
@Configuration
public class CorsConfig {
    @Bean
    public FilterRegistrationBean registrationBean(){
        FilterRegistrationBean bean = new FilterRegistrationBean();
        bean.setFilter(new WebCorsFilter());
        return bean;
    }
}
